package website.sgg.simpleFactory;

/**
 * @author: longhc@citycloud.com.cn
 * @since: 2023/1/10 10:32
 * @version: 1.0
 */
public class OrderPizza {
    public Pizza getPizza(String name) {
        if ("A".equals(name)) {
            return new PozzaA();
        }
        if ("B".equals(name)) {
            return new PozzaB();
        }
        return null;
    }

    public static void main(String[] args) {
        OrderPizza orderPizza = new OrderPizza();
        Pizza a = orderPizza.getPizza("A");
        System.out.println(a.hashCode());
    }
}
